<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
	<!-- if you change something here you probably want to change the glue version too -->

	<Script file="GraphicsQualityLevels.lua"/>
	<Script file="OptionsPanelTemplates.lua"/>
	<Script file="VideoOptionsPanels.lua"/>

	<!-- Resolution Panel -->

	<Frame name="VideoOptionsResolutionPanel" hidden="false" parent="VideoOptionsFramePanelContainer">
		<Layers>
			<Layer level="ARTWORK">
				<FontString name="$parentTitle" text="RESOLUTION_LABEL" inherits="GameFontNormalLarge" justifyH="LEFT" justifyV="TOP">
					<Anchors>
						<Anchor point="TOPLEFT">
							<Offset>
								<AbsDimension x="16" y="-16"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
				<FontString name="$parentSubText" text="RESOLUTION_SUBTEXT" inherits="GameFontHighlightSmall" nonspacewrap="true" maxLines="3" justifyH="LEFT" justifyV="TOP">
					<Size>
						<AbsDimension y="32" x="0"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="$parentTitle" relativePoint="BOTTOMLEFT">
							<Offset>
								<AbsDimension x="0" y="-8"/>
							</Offset>
						</Anchor>
						<Anchor point="RIGHT">
							<Offset>
								<AbsDimension x="-32" y="0"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		<Scripts>
			<OnLoad>
				VideoOptionsResolutionPanel_OnLoad(self);
			</OnLoad>
		</Scripts>	
		<Frames>
			<Frame name="$parentResolutionDropDown" inherits="UIDropDownMenuTemplate" enableMouse="true">
				<Anchors>
					<Anchor point="TOPLEFT">
						<Offset x="0" y="-92"/>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer level="BACKGROUND">
						<FontString name="$parentLabel" inherits="GameFontNormalSmall" text="RESOLUTION">
							<Anchors>
								<Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT">
									<Offset x="21" y="0"/>
								</Anchor>
							</Anchors>
						</FontString>
					</Layer>
				</Layers>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_DROPDOWN;
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());					
						VideoOptionsResolutionPanelResolutionDropDown_OnLoad(self);
					</OnLoad>
					<OnEnter>
						GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
						GameTooltip:SetText(OPTION_TOOLTIP_USE_RESOLUTION, nil, nil, nil, nil, 1);
					</OnEnter>
					<OnLeave>
						GameTooltip:Hide();
					</OnLeave>
				</Scripts>
			</Frame>
			<Frame name="$parentRefreshDropDown" inherits="UIDropDownMenuTemplate" id="2">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentResolutionDropDown" relativePoint="BOTTOMLEFT">
						<Offset x="0" y="-16"/>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer level="BACKGROUND">
						<FontString name="$parentLabel" inherits="GameFontNormalSmall" text="REFRESH_RATE">
							<Anchors>
								<Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT">
									<Offset x="21" y="0"/>
								</Anchor>
							</Anchors>
						</FontString>
					</Layer>
				</Layers>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_DROPDOWN;
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());						
						VideoOptionsResolutionPanelRefreshDropDown_OnLoad(self);
					</OnLoad>
					<OnEnter>
						GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
						GameTooltip:SetText(OPTION_TOOLTIP_USE_REFRESH, nil, nil, nil, nil, 1);
					</OnEnter>
					<OnLeave>
						GameTooltip:Hide();
					</OnLeave>
				</Scripts>
			</Frame>
			<Frame name="$parentMultiSampleDropDown" inherits="UIDropDownMenuTemplate" id="4">
				<Anchors>
					<Anchor point="LEFT" relativeTo="$parentResolutionDropDown" relativePoint="RIGHT">
						<Offset x="0" y="0"/>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer level="BACKGROUND">
						<FontString name="$parentLabel" inherits="GameFontNormalSmall" text="MULTISAMPLE">
							<Anchors>
								<Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT">
									<Offset x="21" y="0"/>
								</Anchor>
							</Anchors>
						</FontString>
					</Layer>
				</Layers>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_DROPDOWN;
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());	
						VideoOptionsResolutionPanelMultiSampleDropDown_OnLoad(self);
					</OnLoad>
					<OnEnter>
						GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
						GameTooltip:SetText(OPTION_TOOLTIP_MULTISAMPLING, nil, nil, nil, nil, 1);
					</OnEnter>
					<OnLeave>
						GameTooltip:Hide();
					</OnLeave>
				</Scripts>
			</Frame>
			<CheckButton name="$parentUseUIScale" inherits="OptionsSmallCheckButtonTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentMultiSampleDropDown" relativePoint="BOTTOMLEFT">
						<Offset x="16" y="-2"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_CHECKBOX;
						self.cvar = "useUiScale";
						self.restart = true;
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
				</Scripts>
			</CheckButton>
			<Slider name="$parentUIScaleSlider" inherits="OptionsSliderTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentUseUIScale" relativePoint="BOTTOMLEFT">
						<Offset x="5" y="0"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_SLIDER;
						self.cvar = "uiscale";
						self.SetDisplayValue = self.SetValue;
						self.SetValue = function (self, value)
							self:SetDisplayValue(value);
							BlizzardOptionsPanel_SetCVarSafe(self.cvar, value);
						end
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
						BlizzardOptionsPanel_SetupDependentControl(VideoOptionsResolutionPanelUseUIScale, self);
					</OnLoad>
					<OnValueChanged>
						self.newValue = value;
					</OnValueChanged>
				</Scripts>
			</Slider>
			<CheckButton name="$parentVSync" inherits="OptionsSmallCheckButtonTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentRefreshDropDown" relativePoint="BOTTOMLEFT">
						<Offset x="16" y="-8"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_CHECKBOX;
						self.cvar = "gxVSync";
						self.restart = true;
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
				</Scripts>
			</CheckButton>				
			<CheckButton name="$parentTripleBuffer" inherits="OptionsSmallCheckButtonTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentVSync" relativePoint="BOTTOMLEFT">
						<Offset>
							<AbsDimension x="16" y="-4"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_CHECKBOX;
						self.cvar = "gxTripleBuffer";
						self.restart = true;
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
						BlizzardOptionsPanel_SetupDependentControl(VideoOptionsResolutionPanelVSync, self);
					</OnLoad>
				</Scripts>
			</CheckButton>
			<CheckButton name="$parentHardwareCursor" inherits="OptionsSmallCheckButtonTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentTripleBuffer" relativePoint="BOTTOMLEFT">
						<Offset>
							<AbsDimension x="-16" y="-4"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_CHECKBOX;
						self.cvar = "gxCursor";
						self.restart = true;
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
				</Scripts>
			</CheckButton>
			<CheckButton name="$parentFixInputLag" inherits="OptionsSmallCheckButtonTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentHardwareCursor" relativePoint="BOTTOMLEFT">
						<Offset>
							<AbsDimension x="0" y="-4"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_CHECKBOX;
						self.cvar = "gxFixLag";
						self.restart = true;
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
				</Scripts>
			</CheckButton>
			<CheckButton name="$parentWindowed" inherits="OptionsSmallCheckButtonTemplate">
				<Anchors>
					<Anchor point="LEFT" relativeTo="$parentVSync" relativePoint="RIGHT">
						<Offset x="164" y="0"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_CHECKBOX;
						self.cvar = "gxWindow";
						self.restart = true;
						self.setFunc = VideoOptionsResolutionPanel_SetWindowed;
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
				</Scripts>
			</CheckButton>	
			<CheckButton name="$parentMaximized" inherits="OptionsSmallCheckButtonTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentWindowed" relativePoint="BOTTOMLEFT">
						<Offset x="16" y="-4"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_CHECKBOX;
						self.cvar = "gxMaximize";
						self.restart = true;
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
						BlizzardOptionsPanel_SetupDependentControl(VideoOptionsResolutionPanelWindowed, self);
					</OnLoad>
				</Scripts>
			</CheckButton>			
			<CheckButton name="$parentDisableResize" inherits="OptionsSmallCheckButtonTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentMaximized" relativePoint="BOTTOMLEFT">
						<Offset x="0" y="-4"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_CHECKBOX;
						self.cvar = "windowResizeLock";
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
						BlizzardOptionsPanel_SetupDependentControl(VideoOptionsResolutionPanelWindowed, self);
						if ( IsMacClient() ) then
							self:Hide();
						end
					</OnLoad>
				</Scripts>
			</CheckButton>		
			<Frame name="$parentBrightness" inherits="OptionsBoxTemplate">
				<Size x="380" y="96"/>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentFixInputLag" relativePoint="BOTTOMLEFT">
						<Offset x="0" y="-20"/>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer level="ARTWORK">
						<Texture name="$parentGrayScale" file="Interface\OptionsFrame\21stepgrayscale">
							<Size x="356" y="32"/>
							<Anchors>
								<Anchor point="BOTTOMLEFT">
									<Offset x="12" y="12"/>
								</Anchor>
							</Anchors>
						</Texture>
					</Layer>
				</Layers>
				<Scripts>
					<OnLoad>
						self:SetBackdropBorderColor(0.4, 0.4, 0.4);
						self:SetBackdropColor(0.15, 0.15, 0.15);
						_G[self:GetName().."Title"]:SetText(OPTIONS_BRIGHTNESS);
					</OnLoad>
				</Scripts>
			</Frame>			
			<CheckButton name="$parentDesktopGamma" inherits="OptionsSmallCheckButtonTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentBrightness" relativePoint="TOPLEFT">
						<Offset x="12" y="-8"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_CHECKBOX;
						self.cvar = "desktopGamma";
						self.setFunc = VideoOptionsResolutionPanel_SetGamma;
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
					<OnClick>
						BlizzardOptionsPanel_CheckButton_OnClick(self);
						if ( self:GetParent():IsShown() ) then
							local value;
							if ( self:GetChecked() ) then
								value = 1;
							else
								value = 0;
								SetGamma(VideoOptionsResolutionPanelGammaSlider:GetValue());
							end
							BlizzardOptionsPanel_SetCVarSafe(self.cvar, value);
						end
					</OnClick>
				</Scripts>
			</CheckButton>		
			<Slider name="$parentGammaSlider" inherits="OptionsSliderTemplate">
				<Size x="154" y="17"/>
				<Anchors>
					<Anchor point="TOPRIGHT" relativeTo="$parentBrightness" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="-16" y="-16"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_SLIDER;
						self.label = "gamma";
						self.SetDisplayValue = self.SetValue;
						self.SetValue = function (self, value)
							self:SetDisplayValue(value);
							SetGamma(value);
						end
						self.GetCurrentValue = function (self) return GetGamma(); end;
						_G[self:GetName().."Text"]:SetFontObject("GameFontNormalSmall");
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
					<OnValueChanged>
						self.newValue = value;
						if ( self:GetParent():IsShown() ) then
							SetGamma(value);
						end
					</OnValueChanged>
				</Scripts>
			</Slider>	
		</Frames>
	</Frame>	
	
	<!-- Effects Panel -->

	<Frame name="VideoOptionsEffectsPanel" parent="VideoOptionsFramePanelContainer" hidden="true">
		<Layers>
			<Layer level="ARTWORK">
				<FontString name="$parentTitle" text="EFFECTS_LABEL" inherits="GameFontNormalLarge" justifyH="LEFT" justifyV="TOP">
					<Anchors>
						<Anchor point="TOPLEFT">
							<Offset>
								<AbsDimension x="16" y="-16"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
				<FontString name="$parentSubText" text="EFFECTS_SUBTEXT" inherits="GameFontHighlightSmall" nonspacewrap="true" maxLines="3" justifyH="LEFT" justifyV="TOP">
					<Size>
						<AbsDimension y="32" x="0"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="$parentTitle" relativePoint="BOTTOMLEFT">
							<Offset>
								<AbsDimension x="0" y="-8"/>
							</Offset>
						</Anchor>
						<Anchor point="RIGHT">
							<Offset>
								<AbsDimension x="-32" y="0"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		<Scripts>
			<OnLoad>
				VideoOptionsEffectsPanel_OnLoad(self);
			</OnLoad>
		</Scripts>	
		<Frames>
			<Frame name="$parentQuality" inherits="OptionsBoxTemplate">
				<Size x="380" y="88"/>
				<Anchors>
					<Anchor point="TOPLEFT">
						<Offset x="16" y="-72"/>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer level="ARTWORK">
						<FontString name="$parentLabel" inherits="GameFontNormalLeft" text="LOW">
							<Anchors>
								<Anchor point="TOPLEFT">
									<Offset x="16" y="-8"/>
								</Anchor>
								<Anchor point="RIGHT">
									<Offset x="-16" y="0"/>
								</Anchor>
							</Anchors>
						</FontString>
						<FontString name="$parentSubText" inherits="GameFontHighlightExtraSmallLeftTop" text="This is a description of what happens when you set the quality slider to its Low setting.">
							<Size x="350" y="42"/>
							<Anchors>
								<Anchor point="TOPLEFT" relativeTo="$parentLabel" relativePoint="BOTTOMLEFT">
									<Offset x="0" y="-2"/>
								</Anchor>
							</Anchors>
						</FontString>
					</Layer>
				</Layers>
				<Scripts>
					<OnLoad>
						self:SetBackdropBorderColor(0.4, 0.4, 0.4);
						self:SetBackdropColor(0.15, 0.15, 0.15);
						_G[self:GetName().."Title"]:Hide();
					</OnLoad>
				</Scripts>
			</Frame>		
			<Slider name="$parentQualitySlider" inherits="OptionsSliderTemplate">
				<Size x="348" y="17"/>
				<Anchors>
					<Anchor point="BOTTOMLEFT" relativeTo="$parentQuality" relativePoint="BOTTOMLEFT">
						<Offset>
							<AbsDimension x="16" y="16"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer level="ARTWORK">
						<FontString name="$parentCustom" inherits="GameFontHighlightSmall" text="CUSTOM">
							<Anchors>
								<Anchor point="TOPRIGHT" relativePoint="BOTTOMRIGHT">
									<Offset>
										<AbsDimension x="4" y="3"/>
									</Offset>
								</Anchor>
							</Anchors>
						</FontString>
					</Layer>
				</Layers>
				<Scripts>
					<OnLoad>
						local name = self:GetName();
						_G[name.."High"]:SetPoint("TOPRIGHT", "$parent", "BOTTOMRIGHT", -79, 3);
						_G[name.."Text"]:SetFontObject("GameFontNormalSmall");

						self.type = CONTROLTYPE_SLIDER;
						self.label = "quality";
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
					<OnValueChanged>
						self.newValue = value;
						if ( self:GetParent():IsShown() ) then
							VideoOptionsEffectsPanel_SetVideoQuality(value);
						end
					</OnValueChanged>
				</Scripts>
			</Slider>	
			<Slider name="$parentViewDistance" inherits="OptionsSliderTemplate">
				<Size x="112" y="17"/>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentQuality" relativePoint="BOTTOMLEFT">
						<Offset x="2" y="-20"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_SLIDER;
						self.cvar = "farclip";
						self.SetDisplayValue = self.SetValue;
						self.SetValue = function (self, value)
							self:SetDisplayValue(value);
							BlizzardOptionsPanel_SetCVarSafe(self.cvar, value);
						end
						_G[self:GetName().."Text"]:SetFontObject("GameFontNormalSmall");
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
					<OnValueChanged>
						self.newValue = value;
						if ( self:GetParent():IsShown() ) then
							VideoOptionsEffectsPanel_UpdateVideoQuality();
						end
					</OnValueChanged>
				</Scripts>
			</Slider>		
			<Slider name="$parentTerrainDetail" inherits="OptionsSliderTemplate">
				<Size x="112" y="17"/>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentViewDistance" relativePoint="BOTTOMLEFT">
						<Offset x="0" y="-24"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_SLIDER;
						self.label = "TerrainMip";
						self.SetDisplayValue = self.SetValue;
						self.SetValue = function (self, value)
							self:SetDisplayValue(value);
							SetTerrainMip(value);
						end
						self.GetCurrentValue = function (self) return GetTerrainMip(); end;
						_G[self:GetName().."Text"]:SetFontObject("GameFontNormalSmall");
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
					<OnValueChanged>
						self.newValue = value;
						if ( self:GetParent():IsShown() ) then
							VideoOptionsEffectsPanel_UpdateVideoQuality();
						end
					</OnValueChanged>
				</Scripts>
			</Slider>			
			<Slider name="$parentSpellDetail" inherits="OptionsSliderTemplate">
				<Size x="112" y="17"/>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentTerrainDetail" relativePoint="BOTTOMLEFT">
						<Offset x="0" y="-24"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						local name = self:GetName();
						self.type = CONTROLTYPE_SLIDER;
						self.cvar = "spellEffectLevel";
						self.SetDisplayValue = self.SetValue;
						self.SetValue = function (self, value)
							self:SetDisplayValue(value);
							BlizzardOptionsPanel_SetCVarSafe(self.cvar, value);
						end
						_G[name.."Text"]:SetFontObject("GameFontNormalSmall");
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
					<OnValueChanged>
						self.newValue = value;
						if ( self:GetParent():IsShown() ) then
							VideoOptionsEffectsPanel_UpdateVideoQuality();
						end
					</OnValueChanged>
				</Scripts>
			</Slider>		
			<Slider name="$parentEnvironmentDetail" inherits="OptionsSliderTemplate">
				<Size x="112" y="17"/>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentViewDistance" relativePoint="TOPRIGHT">
						<Offset x="20" y="0"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_SLIDER;
						self.cvar = "environmentDetail";
						self.SetDisplayValue = self.SetValue;
						self.SetValue = function (self, value)
							self:SetDisplayValue(value);
							BlizzardOptionsPanel_SetCVarSafe(self.cvar, value);
						end
						_G[self:GetName().."Text"]:SetFontObject("GameFontNormalSmall");
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
					<OnValueChanged>
						self.newValue = value;
						if ( self:GetParent():IsShown() ) then
							VideoOptionsEffectsPanel_UpdateVideoQuality();
						end
					</OnValueChanged>
				</Scripts>
			</Slider>		
			<Slider name="$parentClutterDensity" inherits="OptionsSliderTemplate">
				<Size x="112" y="17"/>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentEnvironmentDetail" relativePoint="BOTTOMLEFT">
						<Offset x="0" y="-24"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_SLIDER;
						self.cvar = "groundEffectDensity";
						self.SetDisplayValue = self.SetValue;
						self.SetValue = function (self, value)
							self:SetDisplayValue(value);
							BlizzardOptionsPanel_SetCVarSafe(self.cvar, value);
						end
						_G[self:GetName().."Text"]:SetFontObject("GameFontNormalSmall");
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
					<OnValueChanged>
						self.newValue = value;
						if ( self:GetParent():IsShown() ) then
							VideoOptionsEffectsPanel_UpdateVideoQuality();
						end
					</OnValueChanged>
				</Scripts>
			</Slider>		
			<Slider name="$parentClutterRadius" inherits="OptionsSliderTemplate">
				<Size x="112" y="17"/>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentClutterDensity" relativePoint="BOTTOMLEFT">
						<Offset x="0" y="-24"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_SLIDER;
						self.cvar = "groundEffectDist";
						self.SetDisplayValue = self.SetValue;
						self.SetValue = function (self, value)
							self:SetDisplayValue(value);
							BlizzardOptionsPanel_SetCVarSafe(self.cvar, value);
						end
						_G[self:GetName().."Text"]:SetFontObject("GameFontNormalSmall");
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
					<OnValueChanged>
						self.newValue = value;
						if ( self:GetParent():IsShown() ) then
							VideoOptionsEffectsPanel_UpdateVideoQuality();
						end
					</OnValueChanged>
				</Scripts>
			</Slider>					
			<Slider name="$parentShadowQuality" inherits="OptionsSliderTemplate">
				<Size x="112" y="17"/>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentClutterRadius" relativePoint="BOTTOMLEFT">
						<Offset x="0" y="-24"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						local name = self:GetName();
						self.type = CONTROLTYPE_SLIDER;
						self.cvar = "extShadowQuality";
						self.SetDisplayValue = self.SetValue;
						self.SetValue = function (self, value)
							self:SetDisplayValue(value);
							BlizzardOptionsPanel_SetCVarSafe(self.cvar, value);
						end
						_G[name.."Text"]:SetFontObject("GameFontNormalSmall");
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
					<OnValueChanged>
						self.newValue = value;
						if ( self:GetParent():IsShown() ) then
							VideoOptionsEffectsPanel_UpdateVideoQuality();
						end
					</OnValueChanged>
				</Scripts>
			</Slider>			
			<Slider name="$parentTextureResolution" inherits="OptionsSliderTemplate">
				<Size x="112" y="17"/>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentEnvironmentDetail" relativePoint="TOPRIGHT">
						<Offset x="20" y="0"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_SLIDER;
						self.cvar = "BaseMip";
						self.SetDisplayValue = self.SetValue;
						self.SetValue = function (self, value)
							self:SetDisplayValue(value);
							local min, max = self:GetMinMaxValues();
							BlizzardOptionsPanel_SetCVarSafe(self.cvar, max - value + min); --With this cvar, lower is actually better quality.
						end
						self.GetCurrentValue = function (self)
							local value = BlizzardOptionsPanel_GetCVarSafe(self.cvar);
							local min, max = self:GetMinMaxValues();
							return min - value + max;
						end
						_G[self:GetName().."Text"]:SetFontObject("GameFontNormalSmall");
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
					<OnValueChanged>
						self.newValue = value;
						if ( self:GetParent():IsShown() ) then
							VideoOptionsEffectsPanel_UpdateVideoQuality();
						end
					</OnValueChanged>
				</Scripts>
			</Slider>	
			<Slider name="$parentTextureFiltering" inherits="OptionsSliderTemplate">
				<Size x="112" y="17"/>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentTextureResolution" relativePoint="BOTTOMLEFT">
						<Offset x="0" y="-24"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_SLIDER;
						self.cvar = "textureFilteringMode";
						self.SetDisplayValue = self.SetValue;
						self.SetValue = function (self, value)
							self:SetDisplayValue(value);
							BlizzardOptionsPanel_SetCVarSafe(self.cvar, value);
						end
						_G[self:GetName().."Text"]:SetFontObject("GameFontNormalSmall");
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
					<OnValueChanged>
						self.newValue = value;
						if ( self:GetParent():IsShown() ) then
							VideoOptionsEffectsPanel_UpdateVideoQuality();
						end
					</OnValueChanged>
				</Scripts>
			</Slider>				
			<Slider name="$parentWeatherIntensity" inherits="OptionsSliderTemplate">
				<Size x="112" y="17"/>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentTextureFiltering" relativePoint="BOTTOMLEFT">
						<Offset x="0" y="-24"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_SLIDER;
						self.cvar = "weatherDensity";
						self.SetDisplayValue = self.SetValue;
						self.SetValue = function (self, value)
							self:SetDisplayValue(value);
							BlizzardOptionsPanel_SetCVarSafe(self.cvar, value);
						end
						_G[self:GetName().."Text"]:SetFontObject("GameFontNormalSmall");
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
					<OnValueChanged>
						self.newValue = value;
						if ( self:GetParent():IsShown() ) then
							VideoOptionsEffectsPanel_UpdateVideoQuality();
						end
					</OnValueChanged>
				</Scripts>
			</Slider>	
			<Frame name="$parentShaders" inherits="OptionsBoxTemplate">
				<Size x="380" y="76"/>
				<Anchors>
					<Anchor point="BOTTOMLEFT">
						<Offset x="16" y="16"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self:SetBackdropBorderColor(0.4, 0.4, 0.4);
						self:SetBackdropColor(0.15, 0.15, 0.15);
						_G[self:GetName().."Title"]:SetText(OPTIONS_SHADERS);
					</OnLoad>
				</Scripts>
			</Frame>	
			<CheckButton name="$parentSpecularLighting" inherits="OptionsSmallCheckButtonTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentShaders" relativePoint="TOPLEFT">
						<Offset x="12" y="-8"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_CHECKBOX;
						self.cvar = "specular";
						self.restart = true;
						self.setFunc = VideoOptionsEffectsPanel_UpdateVideoQuality;
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
				</Scripts>
			</CheckButton>	
			<CheckButton name="$parentFullScreenGlow" inherits="OptionsSmallCheckButtonTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentSpecularLighting" relativePoint="BOTTOMLEFT">
						<Offset x="0" y="-8"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_CHECKBOX;
						self.cvar = "ffxGlow";
						self.restart = true;
						self.setFunc = VideoOptionsEffectsPanel_UpdateVideoQuality;
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
				</Scripts>
			</CheckButton>		
			<CheckButton name="$parentDeathEffect" inherits="OptionsSmallCheckButtonTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentShaders">
						<Offset x="180" y="-8"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_CHECKBOX;
						self.cvar = "ffxDeath";
						self.restart = true;
						self.setFunc = VideoOptionsEffectsPanel_UpdateVideoQuality;
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
				</Scripts>
			</CheckButton>					
		</Frames>
	</Frame>	
	<Frame name="VideoOptionsStereoPanel" parent="VideoOptionsFramePanelContainer" hidden="true">
		<Layers>
			<Layer level="ARTWORK">
				<FontString name="$parentTitle" text="STEREO_VIDEO_LABEL" inherits="GameFontNormalLarge" justifyH="LEFT" justifyV="TOP">
					<Anchors>
						<Anchor point="TOPLEFT">
							<Offset>
								<AbsDimension x="16" y="-16"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
				<FontString name="$parentSubText" text="STEREO_VIDEO_SUBTEXT" inherits="GameFontHighlightSmall" nonspacewrap="true" maxLines="3" justifyH="LEFT" justifyV="TOP">
					<Size>
						<AbsDimension y="32" x="0"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="$parentTitle" relativePoint="BOTTOMLEFT">
							<Offset>
								<AbsDimension x="0" y="-8"/>
							</Offset>
						</Anchor>
						<Anchor point="RIGHT">
							<Offset>
								<AbsDimension x="-32" y="0"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		<Scripts>
			<OnLoad>
				VideoOptionsStereoPanel_OnLoad(self);
			</OnLoad>
		</Scripts>	
		<Frames>		
			<CheckButton name="$parentEnabled" inherits="OptionsSmallCheckButtonTemplate">
				<Anchors>
					<Anchor point="TOP">
						<Offset x="-64" y="-92"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_CHECKBOX;
						self.cvar = "gxStereoEnabled";
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
				</Scripts>
			</CheckButton>
			<Slider name="$parentConvergence" inherits="OptionsSliderTemplate">
				<Size x="270" y="17"/>
				<Anchors>
					<Anchor point="TOP" relativePoint="TOP">
						<Offset x="0" y="-150"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						local name = self:GetName();
						self.type = CONTROLTYPE_SLIDER;
						self.cvar = "gxStereoConvergence";
						self.SetDisplayValue = self.SetValue;
						self.SetValue = function (self, value)
							self:SetDisplayValue(value);
							BlizzardOptionsPanel_SetCVarSafe(self.cvar, value);
						end
						_G[name.."Text"]:SetFontObject("GameFontNormalSmall");
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
						BlizzardOptionsPanel_SetupDependentControl(VideoOptionsStereoPanelEnabled, self);
					</OnLoad>
					<OnValueChanged>
						self.newValue = self:GetValue();
						BlizzardOptionsPanel_SetCVarSafe(self.cvar, self:GetValue())
					</OnValueChanged>
				</Scripts>
			</Slider>
			<Slider name="$parentEyeSeparation" inherits="OptionsSliderTemplate">
				<Size x="270" y="17"/>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentConvergence" relativePoint="BOTTOMLEFT">
						<Offset x="0" y="-70"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						local name = self:GetName();
						self.type = CONTROLTYPE_SLIDER;
						self.cvar = "gxStereoSeparation";
						self.SetDisplayValue = self.SetValue;
						self.SetValue = function (self, value)
							self:SetDisplayValue(value);
							BlizzardOptionsPanel_SetCVarSafe(self.cvar, value);
						end
						_G[name.."Text"]:SetFontObject("GameFontNormalSmall");
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
						BlizzardOptionsPanel_SetupDependentControl(VideoOptionsStereoPanelEnabled, self);
					</OnLoad>
					<OnValueChanged>
						self.newValue = self:GetValue();
						BlizzardOptionsPanel_SetCVarSafe(self.cvar, self:GetValue())
					</OnValueChanged>
				</Scripts>
			</Slider>		
		</Frames>
	</Frame>
</Ui>

